package com.disputemanager.utility;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class FileUtility {
	
	public static void upload(InputStream in, String fileName) throws IOException{
		
		OutputStream out = new FileOutputStream(fileName);
		byte[] buffer = new byte[1024];
		int read = 0;
		
		while((read = in.read(buffer)) != -1){
			out.write(buffer, 0, read);
		}
		
		out.close();		
	}

}
